import { $discountRemove, $discountUpdate, $grantedList } from "@/api/user/user";
import tableServiceAbstract from "@/core/table/tableService.interface";
export default class discountService implements tableServiceAbstract {
  getTable(params: any): Promise<any> {
    let mParams: { [key: string]: any, user_id: number } = { user_id: 0 };
    mParams.page = params.current;
    mParams.limit = params.pageSize;
    mParams.user_id = params.user_id;
    return $grantedList(mParams);
  }
  delete(params: any): Promise<any> {
    return $discountRemove(params);
  }
  add(params: any): Promise<any> {
    return new Promise((resolve) => {
      resolve({
        data: {
          code: 200,
          data: {},
          msg: 'success',
        }
      });
    })
  }
  edit(params: any): Promise<any> {
    return $discountUpdate(params);
  }
  detail(params: any): Promise<any> {
    return new Promise((resolve) => {
      resolve({
        data: {
          code: 200,
          data: {},
          msg: 'success',
        }
      });
    })
  }
}
